<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\Resource;

class UsersResource extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'success' => true,
            'region' => $this->region,
            'market' => $this->market,
            'userNum' => $this->username,
            'role' => $this->role,
            'userName' => data_get($this, 'name', ''),
            'company' => data_get($this, 'company', ''),
            'market_level' => data_get($this, 'market_level', ''),
        ];
    }
}
